package mvc.model.dao.impl;

import mvc.common.BaseDao;
import mvc.model.dao.ColorDao;
import mvc.model.pojos.ColorBean;

import java.util.List;

public class ColorDaoImpl implements ColorDao {
    private static BaseDao baseDao = new BaseDao();
    @Override
    public ColorBean query(int cid) {
        String sql = "select * from color where cid = ?;";
        List<ColorBean> query = baseDao.query(sql, ColorBean.class, cid);
        return query.isEmpty() ? null : query.get(0);
    }
}
